\hypertarget{classduye_1_1_tcp_server}{\section{duye\-:\-:Tcp\-Server Class Reference}
\label{classduye_1_1_tcp_server}\index{duye\-::\-Tcp\-Server@{duye\-::\-Tcp\-Server}}
}


tcp server socket class  




{\ttfamily \#include $<$duye\-\_\-tcp\-\_\-server.\-h$>$}

Inheritance diagram for duye\-:\-:Tcp\-Server\-:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=3.000000cm]{classduye_1_1_tcp_server}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{classduye_1_1_tcp_server_acf8b01468310486ea135cd0157775b63}{init\-Server} (\hyperlink{classduye_1_1_tcp_server_if}{Tcp\-Server\-If} $\ast$user)
\begin{DoxyCompactList}\small\item\em init tcp server \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_tcp_server_a96ca307f8047fd6e3fe01e9acbed25f3}{bool {\bfseries init\-Server} (const \hyperlink{classduye_1_1_net_server_para}{Net\-Server\-Para} \&server\-Para, \hyperlink{classduye_1_1_tcp_server_if}{Tcp\-Server\-If} $\ast$user)}\label{classduye_1_1_tcp_server_a96ca307f8047fd6e3fe01e9acbed25f3}

\item 
virtual bool \hyperlink{classduye_1_1_tcp_server_a73b9619bca69ad73298f765857178cb1}{start\-Server} ()
\begin{DoxyCompactList}\small\item\em start tcp server, rewrite abstract interface from \hyperlink{classduye_1_1_net_server}{Net\-Server} \end{DoxyCompactList}\item 
virtual bool \hyperlink{classduye_1_1_tcp_server_a5046105d06cfdddae09b0dab2be4ad87}{stop\-Server} ()
\begin{DoxyCompactList}\small\item\em stop tcp server, implementation abstract interface for \hyperlink{classduye_1_1_net_server}{Net\-Server} \end{DoxyCompactList}\item 
const \hyperlink{classduye_1_1_i_pv4_addr}{I\-Pv4\-Addr} \& \hyperlink{classduye_1_1_tcp_server_a86752ec98b9959b825569025a735efd2}{ipv4\-Addr} ()
\begin{DoxyCompactList}\small\item\em get server I\-Pv4 address \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_tcp_server_af76e3debfaa845aa58ac826c85177b94}{bool {\bfseries add\-Client} (const int32 sockfd)}\label{classduye_1_1_tcp_server_af76e3debfaa845aa58ac826c85177b94}

\item 
\hypertarget{classduye_1_1_tcp_server_ad32897dea4662b1a9d8e401d5c2515d8}{bool {\bfseries remove\-Client} (const int32 sockfd)}\label{classduye_1_1_tcp_server_ad32897dea4662b1a9d8e401d5c2515d8}

\item 
int64 \hyperlink{classduye_1_1_tcp_server_a206686d7cdb11fa5dfcf25f726e53405}{send} (const int32 client\-Sockfd, const int8 $\ast$data, const uint64 len)
\begin{DoxyCompactList}\small\item\em send data \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\hypertarget{classduye_1_1_tcp_server_a99fc42f0a589df8f29aaa2e218fcbcca}{virtual bool {\bfseries on\-Net\-Event} (\hyperlink{classduye_1_1_hcn_event}{Hcn\-Event} $\ast$event)}\label{classduye_1_1_tcp_server_a99fc42f0a589df8f29aaa2e218fcbcca}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
tcp server socket class 

\subsection{Member Function Documentation}
\hypertarget{classduye_1_1_tcp_server_acf8b01468310486ea135cd0157775b63}{\index{duye\-::\-Tcp\-Server@{duye\-::\-Tcp\-Server}!init\-Server@{init\-Server}}
\index{init\-Server@{init\-Server}!duye::TcpServer@{duye\-::\-Tcp\-Server}}
\subsubsection[{init\-Server}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Tcp\-Server\-::init\-Server (
\begin{DoxyParamCaption}
\item[{{\bf Tcp\-Server\-If} $\ast$}]{user}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_tcp_server_acf8b01468310486ea135cd0157775b63}


init tcp server 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em server\-Para} & \-: server information \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\hypertarget{classduye_1_1_tcp_server_a86752ec98b9959b825569025a735efd2}{\index{duye\-::\-Tcp\-Server@{duye\-::\-Tcp\-Server}!ipv4\-Addr@{ipv4\-Addr}}
\index{ipv4\-Addr@{ipv4\-Addr}!duye::TcpServer@{duye\-::\-Tcp\-Server}}
\subsubsection[{ipv4\-Addr}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf I\-Pv4\-Addr}\& duye\-::\-Tcp\-Server\-::ipv4\-Addr (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_tcp_server_a86752ec98b9959b825569025a735efd2}


get server I\-Pv4 address 

\begin{DoxyReturn}{Returns}
I\-Pv4 address 
\end{DoxyReturn}
\hypertarget{classduye_1_1_tcp_server_a206686d7cdb11fa5dfcf25f726e53405}{\index{duye\-::\-Tcp\-Server@{duye\-::\-Tcp\-Server}!send@{send}}
\index{send@{send}!duye::TcpServer@{duye\-::\-Tcp\-Server}}
\subsubsection[{send}]{\setlength{\rightskip}{0pt plus 5cm}int64 duye\-::\-Tcp\-Server\-::send (
\begin{DoxyParamCaption}
\item[{const int32}]{client\-Sockfd, }
\item[{const int8 $\ast$}]{data, }
\item[{const uint64}]{len}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_tcp_server_a206686d7cdb11fa5dfcf25f726e53405}


send data 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em data} & \-: send data \\
\hline
\mbox{\tt in}  & {\em len} & \-: data length \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
size/-\/1 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}
\hypertarget{classduye_1_1_tcp_server_a73b9619bca69ad73298f765857178cb1}{\index{duye\-::\-Tcp\-Server@{duye\-::\-Tcp\-Server}!start\-Server@{start\-Server}}
\index{start\-Server@{start\-Server}!duye::TcpServer@{duye\-::\-Tcp\-Server}}
\subsubsection[{start\-Server}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool duye\-::\-Tcp\-Server\-::start\-Server (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{classduye_1_1_tcp_server_a73b9619bca69ad73298f765857178cb1}


start tcp server, rewrite abstract interface from \hyperlink{classduye_1_1_net_server}{Net\-Server} 

\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}


Implements \hyperlink{classduye_1_1_net_server_aa8c00e9883e8094f9348aeb49e539005}{duye\-::\-Net\-Server}.

\hypertarget{classduye_1_1_tcp_server_a5046105d06cfdddae09b0dab2be4ad87}{\index{duye\-::\-Tcp\-Server@{duye\-::\-Tcp\-Server}!stop\-Server@{stop\-Server}}
\index{stop\-Server@{stop\-Server}!duye::TcpServer@{duye\-::\-Tcp\-Server}}
\subsubsection[{stop\-Server}]{\setlength{\rightskip}{0pt plus 5cm}virtual bool duye\-::\-Tcp\-Server\-::stop\-Server (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}}\label{classduye_1_1_tcp_server_a5046105d06cfdddae09b0dab2be4ad87}


stop tcp server, implementation abstract interface for \hyperlink{classduye_1_1_net_server}{Net\-Server} 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em server\-Para} & \-: server information \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}


Implements \hyperlink{classduye_1_1_net_server_a39bc762d23649f4dace78cafbbda7c5c}{duye\-::\-Net\-Server}.



The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Z\-:/duye/src/duyebase/net/\hyperlink{duye__tcp__server_8h}{duye\-\_\-tcp\-\_\-server.\-h}\end{DoxyCompactItemize}
